'''
Created on May 29, 2012

@author: mupet
'''

import wx

class BehaviourTab(wx.Panel):
    
    name = "Behaviour"
    
    behaviours = []
    
    class BehaviourRow(object):
        
        levels = ['kernel',]
        
        def __init__(self, parentWidget, behaviourId, regex, time, quantity):
            self.parentWidget = parentWidget
            self.behaviourId = behaviourId
            self.regex = regex
            self.time = time
            self.quantity = quantity
        
        def getBoxSizer(self):
            boxSizer = wx.BoxSizer(wx.HORIZONTAL)
            removeButton = wx.Button(self.parentWidget, id=self.behaviourId, label='Remove')
            boxSizer.Add(removeButton)
            
            #regex or whatever
            
            slider = wx.Slider(self.parentWidget, value=60, minValue=1, maxValue=3600, size=(250,-1))
            boxSizer.Add(slider)
            return boxSizer
    
    def createUI(self, sizer):
        row = self.BehaviourRow(self,1,1,1,1)
        sizer.Add(row.getBoxSizer(), pos=(0,0))
        pass

    def __init__(self, parent, generalEventListener):
        '''
        Constructor
        '''
        wx.Panel.__init__(self, parent)
        self.setListener(generalEventListener)
        sizer = wx.GridBagSizer(2, 3)
        self.SetSizer(sizer)
        self.createUI(sizer)
    
    def setListener(self, generalEventListener):
        self.listener = generalEventListener.getGeneralTabListener()
